38 plotly
Uncomment the following line to install leafmap if needed.
# !pip install leafmap
import leafmap.plotlymap as leafmap
If you run into an error saying "FigureWidget - 'mapbox._derived' Value Error" (source), uncomment the following line and run it.
# leafmap.fix_widget_error()
Create an interactive map using default settings.
m = leafmap.Map()
m
Change default setting when creating a map.
Can be one of string from "open-street-map", "carto-positron", "carto-darkmatter", "stamen-terrain", "stamen-toner" or "stamen-watercolor" .
m = leafmap.Map(center=(40, -100), zoom=3, basemap="stamen-terrain", height=500)
m
Set map center and zoom level.
m = leafmap.Map(basemap="stamen-watercolor")
m.set_center(lat=20, lon=0, zoom=2)
m
Print out available basemaps.
leafmap.basemaps.keys()
dict_keys(['OpenStreetMap', 'ROADMAP', 'SATELLITE', 'TERRAIN', 'HYBRID', 'BasemapAT.basemap', 'BasemapAT.grau', 'BasemapAT.highdpi', 'BasemapAT.orthofoto', 'BasemapAT.overlay', 'BasemapAT.surface', 'BasemapAT.terrain', 'CartoDB.DarkMatter', 'CartoDB.DarkMatterNoLabels', 'CartoDB.DarkMatterOnlyLabels', 'CartoDB.Positron', 'CartoDB.PositronNoLabels', 'CartoDB.PositronOnlyLabels', 'CartoDB.Voyager', 'CartoDB.VoyagerLabelsUnder', 'CartoDB.VoyagerNoLabels', 'CartoDB.VoyagerOnlyLabels', 'CyclOSM', 'Esri.AntarcticBasemap', 'Esri.AntarcticImagery', 'Esri.ArcticImagery', 'Esri.ArcticOceanBase', 'Esri.ArcticOceanReference', 'Esri.DeLorme', 'Esri.NatGeoWorldMap', 'Esri.OceanBasemap', 'Esri.WorldGrayCanvas', 'Esri.WorldImagery', 'Esri.WorldPhysical', 'Esri.WorldShadedRelief', 'Esri.WorldStreetMap', 'Esri.WorldTerrain', 'Esri.WorldTopoMap', 'FreeMapSK', 'Gaode.Normal', 'Gaode.Satellite', 'GeoportailFrance.Adminexpress_cog_Latest', 'GeoportailFrance.Adminexpress_cog_carto_Latest', 'GeoportailFrance.Areamanagement_Zfu', 'GeoportailFrance.Areamanagement_Zus', 'GeoportailFrance.Bdcarto_etat_major_Niveau3', 'GeoportailFrance.Bdcarto_etat_major_Niveau4', 'GeoportailFrance.Buildings_Buildings', 'GeoportailFrance.Communes_Prioritydisctrict', 'GeoportailFrance.Dreal_Zonage_pinel', 'GeoportailFrance.Elevation_Contour_Line', 'GeoportailFrance.Elevation_Elevationgridcoverage_Shadow', 'GeoportailFrance.Elevation_Elevationgridcoverage_Threshold', 'GeoportailFrance.Elevation_Level0', 'GeoportailFrance.Elevation_Slopes', 'GeoportailFrance.Elevationgridcoverage_Highres_Quality', 'GeoportailFrance.Forets_Publiques', 'GeoportailFrance.Geographicalgridsystem_Dfci', 'GeoportailFrance.Geographicalgridsystems_1900typemaps', 'GeoportailFrance.Geographicalgridsystems_Bonne', 'GeoportailFrance.Geographicalgridsystems_Etatmajor10', 'GeoportailFrance.Geographicalgridsystems_Etatmajor40', 'GeoportailFrance.Geographicalgridsystems_Maps_Bduni_J1', 'GeoportailFrance.Geographicalgridsystems_Maps_Overview', 'GeoportailFrance.Geographicalgridsystems_Maps_Scan50_1950', 'GeoportailFrance.Geographicalgridsystems_Slopes_Mountain', 'GeoportailFrance.Geographicalgridsystems_Slopes_Pac', 'GeoportailFrance.Geographicalgridsystems_Terrier_v1', 'GeoportailFrance.Geographicalgridsystems_Terrier_v2', 'GeoportailFrance.Geographicalnames_Names', 'GeoportailFrance.Hedge_Hedge', 'GeoportailFrance.Hr_Orthoimagery_Orthophotos', 'GeoportailFrance.Hydrography_Bcae_2022', 'GeoportailFrance.Hydrography_Bcae_Latest', 'GeoportailFrance.Hydrography_Hydrography', 'GeoportailFrance.Insee_Filosofi_Enfants_0_17_Ans_Secret', 'GeoportailFrance.Insee_Filosofi_Logements_Surface_Moyenne_Secret', 'GeoportailFrance.Insee_Filosofi_Niveau_De_Vie_Secret', 'GeoportailFrance.Insee_Filosofi_Part_Familles_Monoparentales_Secret', 'GeoportailFrance.Insee_Filosofi_Part_Individus_25_39_Ans_Secret', 'GeoportailFrance.Insee_Filosofi_Part_Individus_40_54_Ans_Secret', 'GeoportailFrance.Insee_Filosofi_Part_Individus_55_64_Ans_Secret', 'GeoportailFrance.Insee_Filosofi_Part_Logements_Apres_1990_Secret', 'GeoportailFrance.Insee_Filosofi_Part_Logements_Avant_1945_Secret', 'GeoportailFrance.Insee_Filosofi_Part_Logements_Collectifs_Secret', 'GeoportailFrance.Insee_Filosofi_Part_Logements_Construits_1945_1970_Secret', 'GeoportailFrance.Insee_Filosofi_Part_Logements_Construits_1970_1990_Secret', 'GeoportailFrance.Insee_Filosofi_Part_Logements_Sociaux_Secret', 'GeoportailFrance.Insee_Filosofi_Part_Menages_1_Personne_Secret', 'GeoportailFrance.Insee_Filosofi_Part_Menages_5_Personnes_Ouplus_Secret', 'GeoportailFrance.Insee_Filosofi_Part_Menages_Maison_Secret', 'GeoportailFrance.Insee_Filosofi_Part_Menages_Pauvres_Secret', 'GeoportailFrance.Insee_Filosofi_Part_Menages_Proprietaires_Secret', 'GeoportailFrance.Insee_Filosofi_Part_Plus_65_Ans_Secret', 'GeoportailFrance.Insee_Filosofi_Population', 'GeoportailFrance.Landcover_Cha00_fr', 'GeoportailFrance.Landcover_Cha06_dom', 'GeoportailFrance.Landcover_Cha06_fr', 'GeoportailFrance.Landcover_Cha12_dom', 'GeoportailFrance.Landcover_Cha12_fr', 'GeoportailFrance.Landcover_Cha18', 'GeoportailFrance.Landcover_Cha18_dom', 'GeoportailFrance.Landcover_Cha18_fr', 'GeoportailFrance.Landcover_Clc00_dom', 'GeoportailFrance.Landcover_Clc00_fr', 'GeoportailFrance.Landcover_Clc00r_fr', 'GeoportailFrance.Landcover_Clc06_dom', 'GeoportailFrance.Landcover_Clc06_fr', 'GeoportailFrance.Landcover_Clc06r_dom', 'GeoportailFrance.Landcover_Clc06r_fr', 'GeoportailFrance.Landcover_Clc12', 'GeoportailFrance.Landcover_Clc12_dom', 'GeoportailFrance.Landcover_Clc12_fr', 'GeoportailFrance.Landcover_Clc12r', 'GeoportailFrance.Landcover_Clc12r_dom', 'GeoportailFrance.Landcover_Clc12r_fr', 'GeoportailFrance.Landcover_Clc18', 'GeoportailFrance.Landcover_Clc18_dom', 'GeoportailFrance.Landcover_Clc18_fr', 'GeoportailFrance.Landcover_Clc90_fr', 'GeoportailFrance.Landcover_Forestareas', 'GeoportailFrance.Landcover_Forestinventory_V1', 'GeoportailFrance.Landcover_Forestinventory_V2', 'GeoportailFrance.Landcover_Grid_Clc00', 'GeoportailFrance.Landcover_Grid_Clc00_dom', 'GeoportailFrance.Landcover_Grid_Clc00_fr', 'GeoportailFrance.Landcover_Grid_Clc00r_fr', 'GeoportailFrance.Landcover_Grid_Clc06', 'GeoportailFrance.Landcover_Grid_Clc06_dom', 'GeoportailFrance.Landcover_Grid_Clc06_fr', 'GeoportailFrance.Landcover_Grid_Clc06r', 'GeoportailFrance.Landcover_Grid_Clc06r_dom', 'GeoportailFrance.Landcover_Grid_Clc06r_fr', 'GeoportailFrance.Landcover_Grid_Clc12', 'GeoportailFrance.Landcover_Grid_Clc90_fr', 'GeoportailFrance.Landcover_Hr_Dlt_Clc12', 'GeoportailFrance.Landcover_Hr_Dlt_Clc15', 'GeoportailFrance.Landcover_Hr_Gra_Clc15', 'GeoportailFrance.Landcover_Hr_Imd_Clc12', 'GeoportailFrance.Landcover_Hr_Imd_Clc15', 'GeoportailFrance.Landcover_Hr_Tcd_Clc12', 'GeoportailFrance.Landcover_Hr_Tcd_Clc15', 'GeoportailFrance.Landcover_Hr_Waw_Clc15', 'GeoportailFrance.Landcover_Sylvoecoregions', 'GeoportailFrance.Landcover_Sylvoecoregions_Alluvium', 'GeoportailFrance.Landuse_Agriculture2007', 'GeoportailFrance.Landuse_Agriculture2008', 'GeoportailFrance.Landuse_Agriculture2009', 'GeoportailFrance.Landuse_Agriculture2010', 'GeoportailFrance.Landuse_Agriculture2011', 'GeoportailFrance.Landuse_Agriculture2012', 'GeoportailFrance.Landuse_Agriculture2013', 'GeoportailFrance.Landuse_Agriculture2014', 'GeoportailFrance.Landuse_Agriculture2015', 'GeoportailFrance.Landuse_Agriculture2016', 'GeoportailFrance.Landuse_Agriculture2017', 'GeoportailFrance.Landuse_Agriculture2018', 'GeoportailFrance.Landuse_Agriculture2019', 'GeoportailFrance.Landuse_Agriculture2020', 'GeoportailFrance.Limites_administratives_express_Latest', 'GeoportailFrance.Ocsge_Constructions', 'GeoportailFrance.Ocsge_Constructions_2002', 'GeoportailFrance.Ocsge_Constructions_2014', 'GeoportailFrance.Ocsge_Constructions_2016', 'GeoportailFrance.Ocsge_Constructions_2019', 'GeoportailFrance.Ocsge_Couverture', 'GeoportailFrance.Ocsge_Couverture_2002', 'GeoportailFrance.Ocsge_Couverture_2014', 'GeoportailFrance.Ocsge_Couverture_2016', 'GeoportailFrance.Ocsge_Couverture_2019', 'GeoportailFrance.Ocsge_Usage', 'GeoportailFrance.Ocsge_Usage_2002', 'GeoportailFrance.Ocsge_Usage_2014', 'GeoportailFrance.Ocsge_Usage_2016', 'GeoportailFrance.Ocsge_Usage_2019', 'GeoportailFrance.Ocsge_Visu_2016', 'GeoportailFrance.Ocsge_Visu_2019', 'GeoportailFrance.Ortho-sat-rapideye-2010_pyr-jpeg_wld_wm_20160801', 'GeoportailFrance.Ortho-sat-rapideye-2011_pyr-jpeg_wld_wm_2011', 'GeoportailFrance.Orthoimagery_Ortho_sat_Pleiades_2012', 'GeoportailFrance.Orthoimagery_Ortho_sat_Pleiades_2013', 'GeoportailFrance.Orthoimagery_Ortho_sat_Pleiades_2014', 'GeoportailFrance.Orthoimagery_Ortho_sat_Pleiades_2015', 'GeoportailFrance.Orthoimagery_Ortho_sat_Pleiades_2016', 'GeoportailFrance.Orthoimagery_Ortho_sat_Pleiades_2017', 'GeoportailFrance.Orthoimagery_Ortho_sat_Pleiades_2018', 'GeoportailFrance.Orthoimagery_Ortho_sat_Pleiades_2019', 'GeoportailFrance.Orthoimagery_Ortho_sat_Pleiades_2020', 'GeoportailFrance.Orthoimagery_Ortho_sat_Pleiades_2021', 'GeoportailFrance.Orthoimagery_Ortho_sat_Pleiades_2022', 'GeoportailFrance.Orthoimagery_Ortho_sat_Rapideye_2010', 'GeoportailFrance.Orthoimagery_Ortho_sat_Rapideye_2011', 'GeoportailFrance.Orthoimagery_Ortho_sat_Spot_2013', 'GeoportailFrance.Orthoimagery_Ortho_sat_Spot_2014', 'GeoportailFrance.Orthoimagery_Ortho_sat_Spot_2015', 'GeoportailFrance.Orthoimagery_Ortho_sat_Spot_2016', 'GeoportailFrance.Orthoimagery_Ortho_sat_Spot_2017', 'GeoportailFrance.Orthoimagery_Ortho_sat_Spot_2018', 'GeoportailFrance.Orthoimagery_Ortho_sat_Spot_2019', 'GeoportailFrance.Orthoimagery_Ortho_sat_Spot_2020', 'GeoportailFrance.Orthoimagery_Ortho_sat_Spot_2021', 'GeoportailFrance.Orthoimagery_Orthophos_Restrictedareas', 'GeoportailFrance.Orthoimagery_Orthophotos2000', 'GeoportailFrance.Orthoimagery_Orthophotos2000_2005', 'GeoportailFrance.Orthoimagery_Orthophotos2001', 'GeoportailFrance.Orthoimagery_Orthophotos2002', 'GeoportailFrance.Orthoimagery_Orthophotos2003', 'GeoportailFrance.Orthoimagery_Orthophotos2004', 'GeoportailFrance.Orthoimagery_Orthophotos2005', 'GeoportailFrance.Orthoimagery_Orthophotos2006', 'GeoportailFrance.Orthoimagery_Orthophotos2006_2010', 'GeoportailFrance.Orthoimagery_Orthophotos2007', 'GeoportailFrance.Orthoimagery_Orthophotos2008', 'GeoportailFrance.Orthoimagery_Orthophotos2009', 'GeoportailFrance.Orthoimagery_Orthophotos2010', 'GeoportailFrance.Orthoimagery_Orthophotos2011', 'GeoportailFrance.Orthoimagery_Orthophotos2011_2015', 'GeoportailFrance.Orthoimagery_Orthophotos2012', 'GeoportailFrance.Orthoimagery_Orthophotos2013', 'GeoportailFrance.Orthoimagery_Orthophotos2014', 'GeoportailFrance.Orthoimagery_Orthophotos2015', 'GeoportailFrance.Orthoimagery_Orthophotos2016', 'GeoportailFrance.Orthoimagery_Orthophotos2017', 'GeoportailFrance.Orthoimagery_Orthophotos2018', 'GeoportailFrance.Orthoimagery_Orthophotos2019', 'GeoportailFrance.Orthoimagery_Orthophotos2020', 'GeoportailFrance.Orthoimagery_Orthophotos_1950_1965', 'GeoportailFrance.Orthoimagery_Orthophotos_1980_1995', 'GeoportailFrance.Orthoimagery_Orthophotos_Bdortho', 'GeoportailFrance.Orthoimagery_Orthophotos_Coast2000', 'GeoportailFrance.Orthoimagery_Orthophotos_Ilesdunord', 'GeoportailFrance.Orthoimagery_Orthophotos_Irc', 'GeoportailFrance.Orthoimagery_Orthophotos_Irc_2013', 'GeoportailFrance.Orthoimagery_Orthophotos_Irc_2014', 'GeoportailFrance.Orthoimagery_Orthophotos_Irc_2015', 'GeoportailFrance.Orthoimagery_Orthophotos_Irc_2016', 'GeoportailFrance.Orthoimagery_Orthophotos_Irc_2017', 'GeoportailFrance.Orthoimagery_Orthophotos_Irc_2018', 'GeoportailFrance.Orthoimagery_Orthophotos_Irc_2019', 'GeoportailFrance.Orthoimagery_Orthophotos_Irc_2020', 'GeoportailFrance.Orthoimagery_Orthophotos_Irc_express_2018', 'GeoportailFrance.Orthoimagery_Orthophotos_Irc_express_2019', 'GeoportailFrance.Orthoimagery_Orthophotos_Irc_express_2020', 'GeoportailFrance.Orthoimagery_Orthophotos_Irc_express_2021', 'GeoportailFrance.Orthoimagery_Orthophotos_Irc_express_2022', 'GeoportailFrance.Orthoimagery_Orthophotos_Ortho_asp_pac2020', 'GeoportailFrance.Orthoimagery_Orthophotos_Ortho_asp_pac2021', 'GeoportailFrance.Orthoimagery_Orthophotos_Ortho_asp_pac2022', 'GeoportailFrance.Orthoimagery_Orthophotos_Ortho_express_2017', 'GeoportailFrance.Orthoimagery_Orthophotos_Ortho_express_2019', 'GeoportailFrance.Orthoimagery_Orthophotos_Ortho_express_2020', 'GeoportailFrance.Orthoimagery_Orthophotos_Ortho_express_2021', 'GeoportailFrance.Orthoimagery_Orthophotos_Ortho_express_2022', 'GeoportailFrance.Orthoimagery_Orthophotos_Socle_asp_2018', 'GeoportailFrance.Orthoimagery_Orthophotos_Urgence_Alex', 'GeoportailFrance.Pcrs_Lamb93', 'GeoportailFrance.Protectedareas_Apb', 'GeoportailFrance.Protectedareas_Apg', 'GeoportailFrance.Protectedareas_Aphn', 'GeoportailFrance.Protectedareas_Bios', 'GeoportailFrance.Protectedareas_Gp', 'GeoportailFrance.Protectedareas_Inpg', 'GeoportailFrance.Protectedareas_Mnhn_Cdl_Parcels', 'GeoportailFrance.Protectedareas_Mnhn_Cdl_Perimeter', 'GeoportailFrance.Protectedareas_Mnhn_Conservatoires', 'GeoportailFrance.Protectedareas_Mnhn_Rn_Perimeter', 'GeoportailFrance.Protectedareas_Pn', 'GeoportailFrance.Protectedareas_Pnm', 'GeoportailFrance.Protectedareas_Pnr', 'GeoportailFrance.Protectedareas_Prsf', 'GeoportailFrance.Protectedareas_Ramsar', 'GeoportailFrance.Protectedareas_Rb', 'GeoportailFrance.Protectedareas_Ripn', 'GeoportailFrance.Protectedareas_Rn', 'GeoportailFrance.Protectedareas_Rnc', 'GeoportailFrance.Protectedareas_Rncf', 'GeoportailFrance.Protectedareas_Sic', 'GeoportailFrance.Protectedareas_Znieff1', 'GeoportailFrance.Protectedareas_Znieff1_Sea', 'GeoportailFrance.Protectedareas_Znieff2', 'GeoportailFrance.Protectedareas_Znieff2_Sea', 'GeoportailFrance.Protectedareas_Zps', 'GeoportailFrance.Protectedsites_Mnhn_Reserves_regionales', 'GeoportailFrance.Securoute_Te_1te', 'GeoportailFrance.Securoute_Te_2te48', 'GeoportailFrance.Securoute_Te_All', 'GeoportailFrance.Securoute_Te_Oa', 'GeoportailFrance.Securoute_Te_Pn', 'GeoportailFrance.Securoute_Te_Pnd', 'GeoportailFrance.Securoute_Te_Te120', 'GeoportailFrance.Securoute_Te_Te72', 'GeoportailFrance.Securoute_Te_Te94', 'GeoportailFrance.Thr_Orthoimagery_Orthophotos', 'GeoportailFrance.Transportnetwork_Commontransportelements_Markerpost', 'GeoportailFrance.Transportnetworks_Railways', 'GeoportailFrance.Transportnetworks_Roads', 'GeoportailFrance.Transportnetworks_Roads_Direction', 'GeoportailFrance.Transportnetworks_Runways', 'GeoportailFrance.Transports_Drones_Restrictions', 'GeoportailFrance.Utilityandgovernmentalservices_All', 'GeoportailFrance.orthos', 'GeoportailFrance.parcels', 'GeoportailFrance.plan', 'HikeBike.HikeBike', 'HikeBike.HillShading', 'JusticeMap.americanIndian', 'JusticeMap.asian', 'JusticeMap.black', 'JusticeMap.hispanic', 'JusticeMap.income', 'JusticeMap.multi', 'JusticeMap.nonWhite', 'JusticeMap.plurality', 'JusticeMap.white', 'MtbMap', 'NASAGIBS.ASTER_GDEM_Greyscale_Shaded_Relief', 'NASAGIBS.BlueMarble', 'NASAGIBS.BlueMarble3031', 'NASAGIBS.BlueMarble3413', 'NASAGIBS.ModisAquaBands721CR', 'NASAGIBS.ModisAquaTrueColorCR', 'NASAGIBS.ModisTerraAOD', 'NASAGIBS.ModisTerraBands367CR', 'NASAGIBS.ModisTerraBands721CR', 'NASAGIBS.ModisTerraChlorophyll', 'NASAGIBS.ModisTerraLSTDay', 'NASAGIBS.ModisTerraSnowCover', 'NASAGIBS.ModisTerraTrueColorCR', 'NASAGIBS.ViirsEarthAtNight2012', 'NASAGIBS.ViirsTrueColorCR', 'NLS', 'OPNVKarte', 'OneMapSG.Default', 'OneMapSG.Grey', 'OneMapSG.LandLot', 'OneMapSG.Night', 'OneMapSG.Original', 'OpenAIP', 'OpenFireMap', 'OpenRailwayMap', 'OpenSeaMap', 'OpenSnowMap.pistes', 'OpenStreetMap.BZH', 'OpenStreetMap.BlackAndWhite', 'OpenStreetMap.CH', 'OpenStreetMap.DE', 'OpenStreetMap.France', 'OpenStreetMap.HOT', 'OpenStreetMap.Mapnik', 'OpenTopoMap', 'SafeCast', 'Stadia.AlidadeSmooth', 'Stadia.AlidadeSmoothDark', 'Stadia.OSMBright', 'Stadia.Outdoors', 'Stamen.Terrain', 'Stamen.TerrainBackground', 'Stamen.TerrainLabels', 'Stamen.Toner', 'Stamen.TonerBackground', 'Stamen.TonerHybrid', 'Stamen.TonerLabels', 'Stamen.TonerLines', 'Stamen.TonerLite', 'Stamen.TopOSMFeatures', 'Stamen.TopOSMRelief', 'Stamen.Watercolor', 'Strava.All', 'Strava.Ride', 'Strava.Run', 'Strava.Water', 'Strava.Winter', 'SwissFederalGeoportal.JourneyThroughTime', 'SwissFederalGeoportal.NationalMapColor', 'SwissFederalGeoportal.NationalMapGrey', 'SwissFederalGeoportal.SWISSIMAGE', 'USGS.USImagery', 'USGS.USImageryTopo', 'USGS.USTopo', 'WaymarkedTrails.cycling', 'WaymarkedTrails.hiking', 'WaymarkedTrails.mtb', 'WaymarkedTrails.riding', 'WaymarkedTrails.skating', 'WaymarkedTrails.slopes', 'nlmaps.grijs', 'nlmaps.luchtfoto', 'nlmaps.pastel', 'nlmaps.standaard', 'nlmaps.water'])
Add a basemap.
m = leafmap.Map()
m.add_basemap("OpenTopoMap")
m
Add XYZ tile layer.
m = leafmap.Map()
tile_url = "https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}"
m.add_tile_layer(tile_url, name="Google Satellite", attribution="Google", opacity=1.0)
m
Add a mapbox tile layer. You will need a mapbox token. The map style can be Can be "basic", "streets", "outdoors", "light", "dark", "satellite", or "satellite-streets".
import os
# os.environ["MAPBOX_TOKEN"] = "your-mapbox-token"
m = leafmap.Map()
m.add_mapbox_layer(style="streets")
m
Remove the modebar in the upper-right corner.
m = leafmap.Map(basemap="stamen-toner")
m
m.clear_controls()
Add more buttons to the modebar.
m = leafmap.Map(basemap="carto-positron")
controls = [
'drawline',
'drawopenpath',
'drawclosedpath',
'drawcircle',
'drawrect',
'eraseshape',
]
m.add_controls(controls)
m
Add Cloud Optimized GeoTIFF.
m = leafmap.Map()
url = 'https://opendata.digitalglobe.com/events/california-fire-2020/pre-event/2018-02-16/pine-gulch-fire20/1030010076004E00.tif'
m.add_cog_layer(url, name="Fire (pre-event)")
m
'1'
Add a STAC item via HTTP URL.
m = leafmap.Map()
url = 'https://canada-spot-ortho.s3.amazonaws.com/canada_spot_orthoimages/canada_spot5_orthoimages/S5_2007/S5_11055_6057_20070622/S5_11055_6057_20070622.json'
m.add_stac_layer(url, bands=['B3', 'B2', 'B1'], name='False color')
m
Add a STAC item from Microsoft Planetary Computer.
collection = "landsat-8-c2-l2"
item = "LC08_L2SP_047027_20201204_02_T1"
m = leafmap.Map()
m.add_stac_layer(
collection=collection,
item=item,
bands=["SR_B7", "SR_B5", "SR_B4"],
titiler_endpoint="pc",
)
m
Add a heat map.
url = 'https://raw.githubusercontent.com/plotly/datasets/master/earthquakes-23k.csv'
m = leafmap.Map(basemap="stamen-terrain")
m.add_heatmap(
url, latitude="Latitude", longitude="Longitude", z="Magnitude", name="Earthquake"
)
m
Add a choropleth map.
url = "https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/countries.geojson"
m = leafmap.Map(basemap="stamen-terrain")
m.add_choropleth_map(url, name="Pop", z="POP_EST", colorscale="Viridis")
m
Created: 2021-05-26